-
Notifications
You must be signed in to change notification settings - Fork 801
can config es id's constituent part #100
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
it looks that you have already support for multiple Primary key, but forget remove the code.
…icsearch Conflicts: river/river.go
river/rule.go
Outdated
@@ -13,6 +13,7 @@ type Rule struct { | |||
Index string `toml:"index"` | |||
Type string `toml:"type"` | |||
Parent string `toml:"parent"` | |||
Id []string `toml:"id"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
g/Id/ID/s
river/sync.go
Outdated
pks, err := canal.GetPKValues(rule.TableInfo, row) | ||
if err != nil { | ||
return "", err | ||
var id []interface{} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
var (
ids []interface{}
err error
)
Please add test for this feature. |
I have changed Id to ID, and add test, but can't pass the check. |
etc/river.toml
Outdated
@@ -58,6 +58,8 @@ schema = "test" | |||
table = "t" | |||
index = "test" | |||
type = "t" | |||
# Default will use the mysql's primary key as es's id, if set id will use the id's column value as id | |||
id = ["id", "tags"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please use another rule section for this feature.
Btw, please add this to ReadMe too.
Rest LGTM |
CI failed, please fix it. |
ok |
I have already modify the readme and example config file, and ci check passed |
@@ -53,6 +53,16 @@ func GetPKValues(table *schema.Table, row []interface{}) ([]interface{}, error) | |||
return values, nil | |||
} | |||
|
|||
// Get term column's value | |||
func GetColumnValue(table *schema.Table, column string, row []interface{}) (interface{}, error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please update go-mysql commit version in glide.yml
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rest LGTM
done |
Thanks @WangXiangUSTC |
default the es's id use mysql's PK value, and now can config the id's constituent part use mysql's other column.